<?php 
namespace app\home\controller;
use think\Controller;
// use app\home\controller\Common;
/**
* 文章详情页控制器
*/

class Article extends Common
{
	
	public function index(){
		$artid=input('aid');
		db('article')->where(array('aid'=>$artid))->setInc('click');//点击次数
		$articles=db('article')->find($artid);//当前文章内容
		$cateid=db('article')->where(array('aid'=>$artid))->field('cateid')->find();//当前文章的cateid
		//当前文章所在栏目
		$category=db('category')->where(array('cid'=>$cateid['cateid']))->field('catename')->find();

		$this->assign(
			array(
				'articles'=>$articles,
				'category'=>$category
				)
			
			);

		return $this->fetch('article');
	}
}
